Skip to main content
Version: 4.2

Developing Third-party Algorithm Model

You can upload third-party algorithm models to X-BD, and manage, run and call the model with supOS object data on the platform.

Developing Algorithm Model

A model package should include a folder named backend containing a model algorithm file runtime.py and a dependency file requirements.text, and a model description file manifest.json.

runtime.py

  • Only 3 entry arguments
    • inputData: 2-dimensional array, corresponds to input variables.
    • dataStruct: Defined data structure.
    • config: Custom model configuration.
  • Must contain a whole process function defined as algorithmrun

  • Only one return argument: outputdata.

info

If there are other referenced projects or model files, you can either reference in runtime.py or put them together with runtime.py in the same folder backend.

requirements.txt

For the following dependencies, the requirements file content should be: cvxopt==1.3.0 pipdeptree==2.2.1

manifest.json

ParameterDescription
modelName
  • Must be unique.
  • Cannot end with a number.
  • Cannot exceed 50 in length.
  • Update with the same name.
  • Required.
descriptionCannot exceed 500 in length.
devLanguagePython
versionMust be unique. Required.
versionFeaturesFeatures of the current version. Cannot exceed 500 in length.
runEnvPython. Required.
runEnvVersionPython version: 3.7.1. Required.
runtimeRunClassruntime.py. Required.
inputStructsInput data structure.
[{"name":"temperature","dataType":"Double","description":" temperature"},
{"name":"","dataType":"Double","description":" pressure"}]
outputStructsOutput data structure.
[{"name":"heat","dataType":"Double","description":" heat"}]
configCustom configuration.

Uploading Algorithm Model

  1. Log in to supOS, and then select Data Intelligence > Data Science > Model Management.
  2. Click Import model, select the model file from local and then click OK.